package com.cskaoyan.controller.front;

import com.cskaoyan.bean.po.CommonData;
import com.cskaoyan.bean.po.MarketBrand;
import com.cskaoyan.bean.vo.back.BaseRespVo;
import com.cskaoyan.service.front.FrontBrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 品牌
 *
 * @auther 10-何兴绕
 * @Date 2022年10月14日 13:49
 */
@RestController
@RequestMapping("wx/brand")
public class FrontBrandController {

    @Autowired
    FrontBrandService brandService;

    /**
     * 展示品牌
     *
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("list")
    public BaseRespVo showBrand(Integer page, Integer limit) {
        CommonData commonData = brandService.showBrand(page, limit);
        return BaseRespVo.ok(commonData);
    }

    /**
     * 展示品牌具体信息
     * @param id
     * @return
     */
    @GetMapping("detail")
    public BaseRespVo showBrandDetail(Integer id) {
        MarketBrand marketBrand = brandService.showBrandDetailById(id);
        return BaseRespVo.ok(marketBrand);
    }
}
